<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
  String companyNum=request.getParameter("companyId");
  System.out.println("======================"+companyNum);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>新建公司</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>/style/main.css" rel="stylesheet"
			type="text/css" />
		<link type="text/css" rel="stylesheet"
			href="<%=basePath%>/style/style.css" />
	<script src="<%=basePath%>/Scripts/jquery-1.3.1.js" type="text/javascript"></script>
    <script src="<%=basePath%>/Scripts/jquery.validate.js" type="text/javascript"></script>
	<link href="<%=basePath%>/style/main.css" rel="stylesheet"
			type="text/css" />
		<link type="text/css" rel="stylesheet"
			href="<%=basePath%>/style/style.css" />
	<style>
	body{ padding:10px}
	.mydiv input {
		width: 160px;
		font-size: 15pt;
		border: solid 1px #7F9DB9;
		padding: 8px 10px;
		font-size: 15px;	
       }
	.mydiv{
	background-color: #F1F6FF;
	padding: 10px;
	border:1px solid #5BA8DE;
	}
	.mydiv legend{
	font-size: 20px;	
	}
	label { width: 10em; float: left; }
		label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
		em { font-weight: bold; padding-right: 1em; vertical-align: top; }
		em.error {
		  background:url("<%=basePath%>/images/unchecked.gif") no-repeat 0px 0px;
		  padding-left: 16px;
		}
		em.success {
		  background:url("<%=basePath%>/images/checked.gif") no-repeat 0px 0px;
		  padding-left: 16px;
		}
	</style>
	<script type="text/javascript">
	 $(function(){
  $("#SubCompanyMessage").validate({
		rules: {
			subcommpanyId: { 
				required: true,
				minlength: 6
			},
			sshortName:{
			required:true,
			minlength:4
			},
			sfullName:{
			required:true,
			minlength:4
			},			
			saddress:{
			required:true,
			minlength:4
			},
			schief:{
			required:true,
			minlength:2
			},
			spostcode:{
			required:true,
			minlength:6
			},
			stelephone:{
			required:true,
			minlength:6
			},
			sfax:{
			required:true,
			minlength:6
			},
			semail: {
				required: true,
				email: true
			},
			spound:{
			required:true,
			minlength:3
			},
			scommrate:{
			required:true,
			minlength:3
			}
		},
		messages: {
			subcommpanyId: {
				required: '请输入公司编号',
				minlength: '编号至少六位，字母+数字'
			},
			sshortName: {
				required: '请输入公司简称',
				minlength: '至少四个字符'
			},
			sfullName: {
			required:'请输入公司全称',
			minlength:'至少四个字符'
			},
			saddress: {
			required:'请输入公司地址',
			minlength:'至少四个字符'
			},
			schief:{
			required:'请输入公司负责人姓名',
			minlength:'至少四个字符'
			},
			stelephone:{
			required:'请输入公司电话',
			minlength:'至少8位'
			},
			spostcode:{
			required:'请输入公司邮编',
			minlength:'至少6位'
			},
			sfax:{
			required:'请输入公司传真',
			minlength:'至少6位'
			},
			semail: {
				required: '请输入公司Email',
				email:'请输入正确的Email地址'
			},
			spound:{
			required:'请输入公司主页网址',
			url:'请输入正确的Web地址'
			},
			scommrate:{
			required:'请输入公司开户银行名称',
			minlength:'至少4个字符'
			}
		},	
		
		errorElement: "em", //可以用其他标签，记住把样式也对应修改
		success: function(label) {
			//label指向上面那个错误提示信息标签em
			label.text(" ")				//清空错误提示消息
				.addClass("success");	//加上自定义的success类
		}
	  });});
	
	</script>
  </head>
  
  <body>
<div id="subCompanyDiv" class="mydiv">
    <form id="SubCompanyMessage" action="NewSubcompanyDL" method="post">
    <fieldset> 
    <div class="FuckTittle"><span class="title">基本资料</span></div>
      <p>&nbsp;</p>
      <div class="table4">
    <input type="hidden" id="companyNum" name="companyNum" value="<%=companyNum%>" />
    <p>
    <label for="subcommpanyId">公司编号：</label><input type="text" name="subcommpanyId" id="subcommpanyId"/>&nbsp;&nbsp;&nbsp;&nbsp;
    公司简称:<input type="text" id="sshortName" name="sshortName"/>
    </p><p>&nbsp;</p>
    <p>
     <label for="sfullName">公司全称：</label><input type="text" name="sfullName" id="sfullName"/>&nbsp;&nbsp;&nbsp;&nbsp;
     公司地址:<input type="text" id="saddress" name="saddress"/>
    </p><p>&nbsp;</p>
     <p>
     <label for="schief">公司负责人：</label><input type="text" name="schief" id="schief"/>&nbsp;&nbsp;&nbsp;&nbsp;
     公司电话:<input type="text" id="stelephone" name="stelephone"/>
    </p><p>&nbsp;</p>
    <p>
     <label for="spostcode">公司邮编：</label><input type="text" name="spostcode" id="spostcode"/>&nbsp;&nbsp;&nbsp;&nbsp;
     公司传真：<input type="text" id="sfax" name="sfax"/>
    </p><p>&nbsp;</p>
     <p>
     <label for="semail">公司邮箱：</label><input type="text" name="semail" id="semail"/>&nbsp;&nbsp;&nbsp;&nbsp;
     手续费率：<input type="text" id="spound" name="spound"/>
    </p><p>&nbsp;</p>
     <p>
     <label for="scommrate">佣金比率：</label><input type="text" name="scommrate" id="scommrate"/>&nbsp;&nbsp;&nbsp;&nbsp;

    </p><p>&nbsp;</p>
     <p>
     公司备注：<textarea rows="5" cols="30" id="smemo" name="smemo"></textarea>&nbsp;&nbsp;&nbsp;&nbsp;
    </p><p>&nbsp;</p>
    <p >
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="input" type="submit"  value="保存"  class="btn_1" />&nbsp;&nbsp; <input name="input" type="reset"  value="重置"  class="btn_1" onclick="test2()"/>
    </p></div>
    </fieldset>
   </form>
   </div>   
  </body>
</html>
